{% extends "objects/base.html" %}

{% block title %}МПМ Былины. Каналы: {{ title }}{% endblock %}

{% block menu %}
{% include "objects/menu.html" %}
{% endblock %}


{% block content %}

<h2>{{ title }}:</h2>

<table>
<tr><td>
<div class="pagination">
    <span class="step-links">
        {% if messages.has_previous %}
            <a href="?page={{ messages.previous_page_number }}"><<</a>
        {% endif %}

        <span class="current">
            {{ messages.number }} из {{ messages.paginator.num_pages }}
        </span>

        {% if messages.has_next %}
            <a href="?page={{ messages.next_page_number }}">>></a>
        {% endif %}
    </span>
</div>
</td></tr>

{% for m in messages %}
    <tr>
        <td>
            {% if m.type == 0 %}
            <span class="offtop">
                [{{ m.date|date:"Y-m-d H:i" }}] [оффтоп] <a href="/channels/user/{{m.user.name}}/" class="offtop">{{ m.user.name }}</a> : {{ m.text }}
            </span>
            {% elif m.type == 1 %}
            <span class="bolt">
                [{{ m.date|date:"Y-m-d H:i" }}] <a href="/channels/user/{{m.user.name}}/" class="bolt">{{ m.user.name }}</a> заметил(а) : {{ m.text }}
            </span>
            {% elif m.type == 2 %}
            <span class="scream">
                [{{ m.date|date:"Y-m-d H:i" }}] <a href="/channels/user/{{m.user.name}}/" class="scream">{{ m.user.name }}</a> заорал(а) : {{ m.text }}
            </span>
            {% endif %}
        </td>
    </tr>
{% endfor %}
<tr><td>
<div class="pagination">
    <span class="step-links">
        {% if messages.has_previous %}
            <a href="?page={{ messages.previous_page_number }}"><<</a>
        {% endif %}

        <span class="current">
            {{ messages.number }} из {{ messages.paginator.num_pages }}
        </span>

        {% if messages.has_next %}
            <a href="?page={{ messages.next_page_number }}">>></a>
        {% endif %}
    </span>
</div>
</td></tr>
</table>

{% endblock %}